package com.datatypes;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

public class Track implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/** running information **/
	double avgSpeed = 0;
	double distance = 0;
	double calories = 0;
	long time = 0;
	String SenderID;
	String SenderName; // maybe unnecessary
	boolean Synced = false;

	/************************/
	long date = 0;
	String name = null;
	List<GeoPtr> track = null;

	public Track() {
		avgSpeed = 0;
		this.distance = 0;
		this.calories = 0;
		this.time = 0;
		this.date = 0;
		track = new ArrayList<GeoPtr>();
		Synced = false;
	}

	public Track(double speed, double distance, double calories, long time,
			ArrayList<GeoPtr> lst) {

		avgSpeed = speed;
		this.distance = distance;
		this.calories = calories;
		this.time = time;
		this.date = (Calendar.getInstance()).getTime().getTime();
		track = lst;
		Date dat = new Date(date);
		name = dat.toLocaleString();
		Synced = false;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double GetAvgSpeed() {
		return this.avgSpeed;
	}

	public void SetAvgSpeed(double avgSpeed) {
		this.avgSpeed = avgSpeed;
	}

	public double GetDistance() {
		return this.distance;
	}

	public void SetDistance(double distance) {
		this.distance = distance;
	}

	public double GetCalories() {
		return this.calories;
	}

	public void SetCalories(double calories) {
		this.calories = calories;
	}

	public long GetTrackTime() {
		return this.time;
	}

	public void SetTrackTime(long time) {
		this.time = time;
	}

	public List<GeoPtr> GetGeoPtrList() {
		return this.track;
	}

	public void SetGeoPtrList(List<GeoPtr> points) {
		this.track = (ArrayList<GeoPtr>) points;
	}

	public String GetSenderID() {
		return this.SenderID;
	}

	public String GetSenderName() {
		return this.SenderName;
	}

	public void SetSenderID(String SenderID) {
		this.SenderID = SenderID;
	}

	public void SetSenderName(String SenderName) {
		this.SenderName = SenderName;
	}

	public boolean isSynced() {
		return Synced;
	}

	public void setSynced(boolean synced) {
		Synced = synced;
	}

	public long getTime() {
		return this.time;
	}

	public double getDistance() {
		return this.distance;
	}

	public long getDate() {
		return this.date;
	}

	public String getName() {
		return this.name;
	}

}